import request from '@/config/axios'

// 酒类类型 VO
export interface SupplyTypeVO {
  id: number // 主键ID
  parentId: number // 父级ID
  typeName: string // 类型名称：白酒
  depth: number // 深度
  status: number // 类型状态
  visible: boolean // 是否可见
  sort: number // 显示顺序
  degrees: string //度数
  showYears: string //年份
  fragranceTypes: string //香型
  capacities: string //容量
  units: string //单位
  labels: string //标签
  packings: string //包装
  producingAreas: string //产地
  languages: string //语言
}

// 酒类类型 API
export const SupplyTypeApi = {
  // 查询酒类类型分页
  getSupplyTypePage: async (params: any) => {
    return await request.get({ url: `/wine/supply-type/list`, params })
  },

  // 查询酒类类型详情
  getSupplyType: async (id: number) => {
    return await request.get({ url: `/wine/supply-type/get?id=` + id })
  },

  // 新增酒类类型
  createSupplyType: async (data: SupplyTypeVO) => {
    return await request.post({ url: `/wine/supply-type/create`, data })
  },

  // 修改酒类类型
  updateSupplyType: async (data: SupplyTypeVO) => {
    return await request.put({ url: `/wine/supply-type/update`, data })
  },

  // 删除酒类类型
  deleteSupplyType: async (id: number) => {
    return await request.delete({ url: `/wine/supply-type/delete?id=` + id })
  },

  // 导出酒类类型 Excel
  exportSupplyType: async (params) => {
    return await request.download({ url: `/wine/supply-type/export-excel`, params })
  }
}
